<!--

/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/**
* Dialog to publish map
*
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  Viewers
*/

-->
<html>
<head>
 <link rel="stylesheet" href="../../common/css/global.css">
 <title>Map search results</title>
 <script>

   function build_links() {
     if (top.HEURIST  && top.HEURIST.search)
     {

			var mode = top.HEURIST.displayPreferences["showSelectedOnlyOnMapAndSmarty"];
	 		var currentSearchQuery =
	 				(mode=="selected")
						?top.HEURIST.currentQuery_sel  //top.HEURIST.search.currentSearchQuery_sel
						:((mode=="all")?top.HEURIST.currentQuery_all:top.HEURIST.currentQuery_main);

			if(currentSearchQuery)
			{

	 			var url = top.HEURIST.baseURL+"viewers/map/showMapS.html?" + currentSearchQuery;

				document.getElementById("linkTimeline").href = url;

     			document.getElementById("code-textbox").value = '<iframe src="' + url +
     										'" width="800" height="650" frameborder="0"></iframe>';

	 			var url_kml = top.HEURIST.baseURL+"export/xml/kml.php?" + currentSearchQuery;

				document.getElementById("linkKml").href = url_kml;

	 		}
	 }
   }
 </script>
</head>

<body onLoad="build_links()" width=600 height=200 class="popup">

<div style="display:none;">
	<img src="../../common/images/logo-google-earth.gif" align="middle"> &nbsp; &nbsp;
	<a id="linkKml" href="#" target=_new onClick="setTimeout(window.close, 1000)"><b>Google Earth</b></a>

	<img src="../../common/images/logo-google-maps.gif" align="middle"> &nbsp; &nbsp;
	<a href="#" id="linkTimeline" target=_new onClick="setTimeout(window.close, 200);"><b>Google Map + Timeline</b></a>
</div>

<blockquote>
	Embed this Google Map (plus timeline) in your own web page:
	Copy the following html code into your page where you want to place the map,
	or use the URL on its own. The map will be generated live from the database
	using the current search criteria whenever the map is loaded.
   <br>
   <br>
  <textarea readonly style="border: 1px dotted gray; padding: 3px; margin: 2; font-family: times; font-size: 10px; width: 100%; height: 60px;"
    id=code-textbox onClick="select(); if (window.clipboardData) clipboardData.setData('Text', value);"></textarea>
</blockquote>
<blockquote>
	Note: records will only appear on the map if they include geographic objects.
	You may get an empty or sparsely populated map if the search results do not
	contain map data. Records must have public status.
</blockquote>

</body>
</html>